# coding=utf-8
from wtforms import Form,StringField,FileField
from wtforms.validators import Length,EqualTo,ValidationError
from flask_wtf.file import FileRequired,FileAllowed

class RegisterForm(Form):
    username=StringField(validators=[Length(min=3,max=10,message='用户名的长度在3-10之间')])
    psw=StringField(validators=[Length(min=6,max=10)])
    repsw=StringField(validators=[Length(min=3,max=10),EqualTo('psw')])
class UploadForm(Form):
    username=StringField(validators=[Length(min=2,max=10)])
    file=FileField(validators=[FileRequired('文件必传'),FileAllowed(['jpg','png','jpeg','gif'])])

    

